Integrand size = 26, antiderivative size = 80 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x)) \, dx=2 a^2 (c-i d) x-\frac {2 a^2 (i c+d) \log (\cos (e+f x))}{f}-\frac {a^2 (c-i d) \tan (e+f x)}{f}+\frac {d (a+i a \tan (e+f x))^2}{2 f} \]
[Out]
Time = 0.09 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {3608, 3558, 3556} \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x)) \, dx=-\frac {a^2 (c-i d) \tan (e+f x)}{f}-\frac {2 a^2 (d+i c) \log (\cos (e+f x))}{f}+2 a^2 x (c-i d)+\frac {d (a+i a \tan (e+f x))^2}{2 f} \]
[In]
[Out]
Rule 3556
Rule 3558
Rule 3608
Rubi steps \begin{align*} \text {integral}& = \frac {d (a+i a \tan (e+f x))^2}{2 f}-(-c+i d) \int (a+i a \tan (e+f x))^2 \, dx \\ & = 2 a^2 (c-i d) x-\frac {a^2 (c-i d) \tan (e+f x)}{f}+\frac {d (a+i a \tan (e+f x))^2}{2 f}+\left (2 a^2 (i c+d)\right ) \int \tan (e+f x) \, dx \\ & = 2 a^2 (c-i d) x-\frac {2 a^2 (i c+d) \log (\cos (e+f x))}{f}-\frac {a^2 (c-i d) \tan (e+f x)}{f}+\frac {d (a+i a \tan (e+f x))^2}{2 f} \\ \end{align*}
Time = 0.52 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.72 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x)) \, dx=\frac {a^2 \left (d+4 (i c+d) \log (i+\tan (e+f x))-2 (c-2 i d) \tan (e+f x)-d \tan ^2(e+f x)\right )}{2 f} \]
[In]
[Out]
Time = 0.22 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.95
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\frac {d \left (\tan ^{2}\left (f x +e \right )\right )}{2}-c \tan \left (f x +e \right )+2 i \tan \left (f x +e \right ) d +\frac {\left (2 i c +2 d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-2 i d +2 c \right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(76\) |
default | \(\frac {a^{2} \left (-\frac {d \left (\tan ^{2}\left (f x +e \right )\right )}{2}-c \tan \left (f x +e \right )+2 i \tan \left (f x +e \right ) d +\frac {\left (2 i c +2 d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (-2 i d +2 c \right ) \arctan \left (\tan \left (f x +e \right )\right )\right )}{f}\) | \(76\) |
norman | \(\left (-2 i a^{2} d +2 a^{2} c \right ) x -\frac {\left (-2 i a^{2} d +a^{2} c \right ) \tan \left (f x +e \right )}{f}-\frac {a^{2} d \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {\left (i a^{2} c +a^{2} d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{f}\) | \(87\) |
parallelrisch | \(\frac {-4 i x \,a^{2} d f +2 i \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{2} c +4 i \tan \left (f x +e \right ) a^{2} d +4 x \,a^{2} c f -a^{2} d \left (\tan ^{2}\left (f x +e \right )\right )+2 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a^{2} d -2 \tan \left (f x +e \right ) a^{2} c}{2 f}\) | \(98\) |
parts | \(a^{2} c x +\frac {\left (2 i a^{2} c +a^{2} d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {\left (2 i a^{2} d -a^{2} c \right ) \left (\tan \left (f x +e \right )-\arctan \left (\tan \left (f x +e \right )\right )\right )}{f}-\frac {a^{2} d \left (\frac {\left (\tan ^{2}\left (f x +e \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}\right )}{f}\) | \(104\) |
risch | \(\frac {4 i a^{2} d e}{f}-\frac {4 a^{2} c e}{f}-\frac {2 a^{2} \left (i c \,{\mathrm e}^{2 i \left (f x +e \right )}+3 \,{\mathrm e}^{2 i \left (f x +e \right )} d +i c +2 d \right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}-\frac {2 a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) d}{f}-\frac {2 i a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c}{f}\) | \(120\) |
[In]
[Out]
none
Time = 0.24 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.69 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x)) \, dx=-\frac {2 \, {\left (i \, a^{2} c + 2 \, a^{2} d + {\left (i \, a^{2} c + 3 \, a^{2} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (i \, a^{2} c + a^{2} d + {\left (i \, a^{2} c + a^{2} d\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left (i \, a^{2} c + a^{2} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \]
[In]
[Out]
Time = 0.30 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.52 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x)) \, dx=- \frac {2 i a^{2} \left (c - i d\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac {- 2 i a^{2} c - 4 a^{2} d + \left (- 2 i a^{2} c e^{2 i e} - 6 a^{2} d e^{2 i e}\right ) e^{2 i f x}}{f e^{4 i e} e^{4 i f x} + 2 f e^{2 i e} e^{2 i f x} + f} \]
[In]
[Out]
none
Time = 0.41 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.04 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x)) \, dx=-\frac {a^{2} d \tan \left (f x + e\right )^{2} - 4 \, {\left (a^{2} c - i \, a^{2} d\right )} {\left (f x + e\right )} - 2 \, {\left (i \, a^{2} c + a^{2} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 2 \, {\left (a^{2} c - 2 i \, a^{2} d\right )} \tan \left (f x + e\right )}{2 \, f} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 214 vs. \(2 (70) = 140\).
Time = 0.44 (sec) , antiderivative size = 214, normalized size of antiderivative = 2.68 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x)) \, dx=-\frac {2 \, {\left (i \, a^{2} c e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + a^{2} d e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 2 i \, a^{2} c e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 2 \, a^{2} d e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + i \, a^{2} c e^{\left (2 i \, f x + 2 i \, e\right )} + 3 \, a^{2} d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, a^{2} c \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + a^{2} d \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + i \, a^{2} c + 2 \, a^{2} d\right )}}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \]
[In]
[Out]
Time = 5.89 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.95 \[ \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x)) \, dx=\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a^2\,d\,1{}\mathrm {i}+a^2\,\left (d+c\,1{}\mathrm {i}\right )\,1{}\mathrm {i}\right )}{f}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (2\,a^2\,d+a^2\,c\,2{}\mathrm {i}\right )}{f}-\frac {a^2\,d\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2\,f} \]
[In]
[Out]